package com.heima.comment.config;

import com.heima.comment.interceptor.CommentUserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author jay
 * @date 2022/11/16 17:16:47
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CommentUserInterceptor()).addPathPatterns("/**");
    }
}
